<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<iframe src="http://localhost:4000/b.html"
        frameborder="0" id="iframe" onload="load()"></iframe>


<script>
    function load() {
        let frame=document.getElementById("iframe");
        frame.contentWindow.postMessage("我是fql",
        "http://localhost:4000"
        );//向b.html域发送msg
        window.onmessage=function (e) {
            console.log(e.data)// 接收到 b.html的信息回复
        }


    }
</script>



</body>
</html>